package com.test.crawler.controller;

import com.test.crawler.service.BatchImportProductService;
import com.test.crawler.utils.CrawlerUrl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 仅供学习
 */
@RestController
@RequestMapping("import")
@Api(tags = "商品导入")
@Slf4j
public class BatchImportProductController {
    @Resource
    private BatchImportProductService batchImportProductService;
    /**
     * 列表
     */
    @ApiOperation(value = "商品导入")
    @PostMapping("/importProduct")
    public Result list(CrawlerUrl productSources) {
       return batchImportProductService.batch(productSources);
    }
}
